(function() {
  $(function() {
    $('.nav.with.date').click(function(evt) {
      var end_date, location, start_date;
      evt.preventDefault();
      start_date = $('form input[name=start_date]').val();
      end_date = $('form input[name=end_date]').val();
      location = $(this).data('href') + "?";
      if (start_date != null) {
        location += "start_date=" + start_date + "&";
      }
      if (end_date != null) {
        location += "end_date=" + end_date;
      }
      return window.location = location;
    });
    return $('.link.trlist').click(function(evt) {
      var end_date, k, location, start_date, v, _i, _len, _ref;
      evt.preventDefault();
      start_date = $('form input[name=start_date]').val();
      end_date = $('form input[name=end_date]').val();
      location = "/trlist?";
      if (start_date != null) {
        location += "start_date=" + start_date + "&";
      }
      if (end_date != null) {
        location += "end_date=" + end_date + "&";
      }
      _ref = ['keyword', 'incoming', 'chnl', 'settl', 'succed', 'trcode'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        k = _ref[_i];
        v = $(this).data(k);
        if ((v != null) && v !== '') {
          location += "" + k + "=" + v + "&";
        }
      }
      return window.location = location;
    });
  });

}).call(this);
